//package com.zhangzeqin.code.view;
//
//import com.sun.org.apache.bcel.internal.generic.NEW;
//import com.zhangzeqin.code.controller.WordBookController;
//
//import javax.swing.*;
//import javax.swing.text.html.HTMLDocument;
//import java.awt.*;
//import java.awt.event.ActionEvent;
//import java.awt.event.ActionListener;
//import java.sql.ResultSet;
//import java.sql.SQLException;
//import java.util.Iterator;
//import java.util.Map;
//import java.util.Set;
//
//public class LearnWordHandler {
//    private LearnWordView learnWordView;
//    WordBookController wordBookController = new WordBookController();
//    java.util.List<Map> list;
//    Map map;
//    Set keySet;
//    Iterator iterator;
//    Object key;
//    Object value;
//    int i;
//
//    public LearnWordHandler(LearnWordView learnWordView) {
//        this.learnWordView = learnWordView;
//    }
//
//    public LearnWordHandler() throws SQLException {
//        try {
//            list = wordBookController.getWord("word_book1");
//        } catch (SQLException throwables) {
//            throwables.printStackTrace();
//        }
//
//
////        Map map;
////        Set keySet;
////        Iterator iterator;
////        Object key;
////        Object value;
////        int i;
//        //foreach循环
//        for (i = 0; i < list.size(); ) {
//
//            map = list.get(i);
//            keySet = map.keySet();
//            iterator = keySet.iterator();
//            key = iterator.next();
//            value = map.get(key);
//            learnWordView.wordLabel.setText((String) key);
////            learnWordView.knowButton.addActionListener(new ActionListener() {
////                @Override
////                public void actionPerformed(ActionEvent e) {
////                    i++;
////                    learnWordView.wordLabel.setText((String) key);
////                }
////            });
////            learnWordView.unknowButton.addActionListener(new ActionListener() {
////                @Override
////                public void actionPerformed(ActionEvent e) {
////                    learnWordView.wordLabel.setText((String) value);
////                    i++;
////                }
////            });
////            learnWordView.returnButton.addActionListener(new ActionListener() {
////                @Override
////                public void actionPerformed(ActionEvent e) {
////                    new WordBookView();
////                }
////            });
////        }
//
//        }
//        learnWordView.knowButton.addActionListener(new ActionListener() {
//            @Override
//            public void actionPerformed(ActionEvent e) {
//                i++;
//                learnWordView.wordLabel.setText((String) key);
//            }
//        });
//        learnWordView.unknowButton.addActionListener(new ActionListener() {
//            @Override
//            public void actionPerformed(ActionEvent e) {
//                learnWordView.wordLabel.setText((String) value);
//                i++;
//            }
//        });
//        learnWordView.returnButton.addActionListener(new ActionListener() {
//            @Override
//            public void actionPerformed(ActionEvent e) {
//                new WordBookView();
//            }
//        });
//    }
//}
//
//
//
//
////    @Override
////    public void actionPerformed(ActionEvent e) {
////        JButton jButton = (JButton) e.getSource();
////        String text = jButton.getText();
////        try {
////            list = wordBookController.getWord("word_book1");
////        } catch (SQLException throwables) {
////            throwables.printStackTrace();
////        }
////
////        if ("返回".equals(text)) {
////            new WordBookView();
////        } else {
////            Map map;
////            Set keySet;
////            Iterator iterator;
////            Object key;
////            Object value;
////            //foreach循环
////            for (int i=0;i<list.size();i++) {
////
////                 map=list.get(i);
////                 keySet = map.keySet();
////                 iterator = keySet.iterator();
////                    key = iterator.next();
////                     value = map.get(key);
////                    learnWordView.wordLabel.setText((String) key);
////
////                    if("认识".equals(text)){
////                        text="";
////                    }
////                    else if ("不认识".equals(text)) {
////                        learnWordView.meaningLabel.setText((String) value);
////
////
////                    }
////
////            }
////        }
////    }
//////    }
////}
//
